<template>
  <div class="app-container">
    <el-button @click="clickFn">默认按钮</el-button>
    <editor v-model="state.content" :init="state.setting" />
  </div>
</template>

<script setup name="email">
import axios from "axios";
import Cookies from "js-cookie";
import Editor from '@tinymce/tinymce-vue'//编辑器引入



const state = reactive({
  // editor 配置项
  content: "hello vue3-tinymce!",
  setting: {
    height: 500,
    language: "zh_CN", //注意大小写
    language_url: "/tinymce/lang/zh_CN.js",
    plugins: [
      "advlist autolink lists link image charmap print preview anchor",
      "searchreplace visualblocks code fullscreen",
      "insertdatetime media table paste code help wordcount",
    ],
    // toolbar: {
    //   type: [String, Array],
    //   default:
    //     "undo redo | formatselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | lists image media table | removeformat",
    // },
    images_upload_handler: function (blobInfo, success, failure) {
      //文件上传的formData传递，忘记为什么要用这个了

    },
  },
});

function clickFn() {
  console.log(state.content);
}
</script>
<style lang="scss"></style>
